
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>个人中心界面</title>

    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/css/readeradmin.css">
    <link rel="stylesheet" href="/css/booksearch.css">
    <link rel="stylesheet" href="/css/index.css">
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <style type="text/css">

        span{
            color: aliceblue;
        }
        table{

            width: 980px;
        }


        td{

            overflow: hidden;

        }






        .tupian img {
            float: right;
            width: 980px;
            height: 465px;
        }

        .minyan {
            float: left;
            width: 100%;
            height: 163px;
            margin-top: 12px;
            background-color: green;
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            line-height: 163px;
            color: #fff;
            background: rgba(0, 0, 0, 0.7);
        }

        .c1{
            position: fixed;
            top:0;
            bottom: 0;
            left:0;
            right: 0;
            background: rgba(0,0,0,.5);
            z-index: 2;
        }
#update{
    margin: auto;

}
    </style>
</head>
<body>

<%
    String contextPath = request.getSession().getServletContext().getContextPath();
%>

<section class="shortcut">
    <div class="w">
        <div class="fl">
            <ul>
                <li>图书管理系统！&nbsp;</li>
                <li>
                    <a href="<%=contextPath%>/user/">退出</a>
                    <a href="#" class="style-red">请登录</a>
                </li>
            </ul>
        </div>
        <div class="fr">
            <ul>


                <li class="arrow-icon"><a href="aindex.html">联系管理员</a> </li>
                <li>|</li>
                <li class="arrow-icon"> <a href="login.html">关于图书馆</a></li>
            </ul>
        </div>
    </div>
</section>
<header class="header w">
    <!-- logo -->
    <div class="logo">
        <h1>
            <a href="index.html" title="图书管理系统">人类进步的阶梯</a>
        </h1>
    </div>



</header>
<nav class="nav">
    <div class="w">

        <div class="dropdown">
            <div class="dt"> <a href="index.html">首页</a> </div>
            <div class="dd">
                <ul>
                    <li><a href="<%=contextPath%>/user/library/">图书馆</a> </li>

                    <li><a href="<%=contextPath%>/user/collect/">我的收藏</a> </li>
                    <li><a href="<%=contextPath%>/user/borrow/">我的借阅</a> </li>
                    <li><a href="<%=contextPath%>/user/personCenter/">我的信息</a> </li>
                    <li><a href="<%=contextPath%>/user/inform/all/">通知</a> </li>

                </ul>
            </div>
        </div>
    </div>
</nav>
<div class="w">
    <div class="main">
        <div class="personTable" id="personTable">
            <form id="update" method="post">
                <%--        <h2>修改个人信息</h2>--%>
                <label>用户账号:</label><input type="text" name="zhanghao" readonly="true" class="zhanghao" value=${zhanghao}><br>
                <label>用户名：</label><input type="text" name="username" class="username" value=${username}><br>
                <label>密码:</label><input type="password" name="password" class="password" value=${user.password}><br>
                <label>手机：</label><input type="text" name="phone" class="phone" value=${user.phone}><br>
                <label>邮箱：</label><input type="text" name="email" class="email" value=${user.email}><br><br>
                <input id="submit" type="button" value="确定修改"> <input type="reset" value="重置" >
                    <a href="<%=contextPath%>/user/personCenter/zhuxiao/">注销</a>
                <%--    </form>--%>
            </form>
<%--
        </div>
    </div>
</div>
<div class="w">
    <div class="minyan">

        六经三史，诸子百家，非无可观，皆是为治。
    </div>
</div>

<%--<%--%>
<%--    String contextPath = request.getSession().getServletContext().getContextPath();--%>
<%--%>--%>
<%--<a href="<%=contextPath%>/user/">退出</a><br><br>--%>


<%--<button onclick="javascrtpt:window.location.href='<%=contextPath%>/user/personCenter/zhuxiao/'">注销</button>--%>

<%--<h2>个人中心信息表</h2>--%>

<%--<form id="personTable" name="personTable" border="1px">--%>
<%--        <label>用户账号:</label><input type="text" name="zhanghao" id="zhanghao"><br>--%>
<%--        <label>用户名：</label><input type="text" name="username" id="username"><br>--%>
<%--        <label>密码:</label><input type="password" name="password" id="password"><br>--%>
<%--        <label>手机：</label><input type="text" name="phone" id="phone"><br>--%>
<%--        <label>邮箱：</label><input type="text" name="email" id="email"><br><br>--%>
<%--&lt;%&ndash;        <p>&ndash;%&gt;--%>
<%--&lt;%&ndash;            <input type="button" value="确定" id="submit">&ndash;%&gt;--%>
<%--&lt;%&ndash;            <input type="button" value="取消" onclick="Hide()">&ndash;%&gt;--%>
<%--&lt;%&ndash;            <input type="reset" value="重置" >&ndash;%&gt;--%>
<%--&lt;%&ndash;        </p>&ndash;%&gt;--%>
<%--    </form>--%>
<%--<br><br>--%>

<%--<div class="personTable" id="personTable">--%>
<%--    <form id="update" method="post">--%>
<%--&lt;%&ndash;        <h2>修改个人信息</h2>&ndash;%&gt;--%>
<%--        <label>用户账号:</label><input type="text" name="zhanghao" readonly="true" class="zhanghao" value=${zhanghao}><br>--%>
<%--        <label>用户名：</label><input type="text" name="username" class="username" value=${username}><br>--%>
<%--        <label>密码:</label><input type="password" name="password" class="password" value=${user.password}><br>--%>
<%--        <label>手机：</label><input type="text" name="phone" class="phone" value=${user.phone}><br>--%>
<%--        <label>邮箱：</label><input type="text" name="email" class="email" value=${user.email}><br><br>--%>
<%--        <input id="submit" type="button" value="确定修改"> <input type="reset" value="重置" >--%>
<%--        &lt;%&ndash;    </form>&ndash;%&gt;--%>
<%--    </form>--%>
<%--</div>--%>


<%--<div id="modal" class="c2 hide">--%>
<%--    <form id="cancle">--%>
<%--        <h1 id="title" name="title">注销</h1>--%>

<%--            <input type="button" value="确定" id="submit1">--%>
<%--            <input type="button" value="取消" onclick="Hide()">--%>

<%--    </form>--%>

<%--</div>--%>




</body>

<script>



    $(function (){
        $("#submit").click(function (){
            var zhanghao = $(".zhanghao").val();
            var username = $(".username").val();
            var password = $(".password").val();
            var phone = $(".phone").val();
            var email= $(".email").val();

            if(zhanghao=="" || username=="" || password=="" || phone=="" || email==""){
                alert("用户信息填写不完整");
            }else{
                $.ajax({
                    type:"post",
                    url:"<%=contextPath%>/user/personCenter/update",
                    data:{
                        "zhanghao":zhanghao,
                        "userName":username,
                        "password":password,
                        "phone":phone,
                        "email":email,
                    },
                    success:function (msg){
                        if(msg==true){
                            alert("修改成功！")
                        }else if(msg==false){
                            alert("修改失败")
                        }
                    }
                })
            }


        })
    })


    <%--$(function (){--%>
    <%--    $("#submit1").click(function (){--%>
    <%--        var isreturn = $(".isreturn").val();--%>


    <%--        if(isreturn=" "){--%>
    <%--            alert("请归还图书后，再注销");--%>
    <%--        }else{--%>
    <%--            $.ajax({--%>
    <%--                type:"post",--%>
    <%--                url:"<%=contextPath%>/user/personCenter/cancle",--%>
    <%--                data:{--%>

    <%--                    "isreturn":isreturn,--%>
    <%--                },--%>
    <%--                success:function (msg){--%>
    <%--                    if(msg==true){--%>
    <%--                        alert("注销成功！")--%>
    <%--                    }else if(msg==false){--%>
    <%--                        alert("注销失败")--%>
    <%--                    }--%>
    <%--                }--%>
    <%--            })--%>
    <%--        }--%>


    <%--    })--%>
    <%--})--%>


</script>



</html>
